home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / penguin.swf / scripts / __Packages / Class / Bullet2.as < prev    next >
Encoding:
Text File  |  2007-06-26  |  1.1 KB  |  45 lines

  1. class Class.Bullet2 extends Class.Bullet
  2. {
  3.    var x;
  4.    var y;
  5.    function Bullet2()
  6.    {
  7.       super();
  8.    }
  9.    function checkHit()
  10.    {
  11.       var _loc4_ = _root.mc.balloonArray;
  12.       var _loc5_ = 20;
  13.       for(var _loc6_ in _loc4_)
  14.       {
  15.          var _loc3_ = _loc4_[_loc6_];
  16.          if(this.hitTest(_loc3_.area))
  17.          {
  18.             if(_loc3_.inHit)
  19.             {
  20.                return undefined;
  21.             }
  22.             _loc3_.hit();
  23.             _loc3_.inHit = true;
  24.             _root.soundStart("balloon_snd");
  25.             _root.mc.balloonNum--;
  26.             _root.mc.balloonHit = _root.mc.balloonHit + 1;
  27.             _root.setScore(_loc5_,"balloon");
  28.             _root.UI_mc.setBalloonNum();
  29.             return undefined;
  30.          }
  31.       }
  32.    }
  33.    function hit()
  34.    {
  35.    }
  36.    function moveStop()
  37.    {
  38.       _root.mc.addObj("bulletStick",this.x,this.y + 20,3 + int(Math.random() * 3));
  39.       this._visible = false;
  40.       this.gotoAndStop(1);
  41.       _root.playControl.onShootEnd();
  42.       _root.soundStart("hit2_snd");
  43.    }
  44. }
  45.